home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / CMICCProfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  28.9 KB  |  887 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMICCProfile.h
  3.  
  4.      Contains:    Definitions for ColorSync 2.0 profile
  5.  
  6.      Version:    Technology:    ColorSync 2.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CMICCPROFILE__
  19. #define __CMICCPROFILE__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47. /* Current CMProfile.header.profileVersion Major: 2, Minor: 0, Stage: Developement (x20), Prerelease:0x01 */
  48.  
  49. enum {
  50.     cmCS2ProfileVersion            = 0x02000000
  51. };
  52.  
  53. /* Current Major version number */
  54.  
  55. enum {
  56.     cmCurrentProfileMajorVersion = 0x02000000
  57. };
  58.  
  59. /* magic cookie number for anonymous file ID */
  60.  
  61. enum {
  62.     cmMagicNumber                = FOUR_CHAR_CODE('acsp')
  63. };
  64.  
  65. /* ColorSync profile version 1.0 */
  66.  
  67. enum {
  68.     cmCS1ProfileVersion            = 0x00000100
  69. };
  70.  
  71.  
  72. /************************************************************************/
  73. /*************** ColorSync 2.0 profile specification ********************/
  74. /************************************************************************/
  75. /**** flags field  ****/
  76.  
  77. enum {
  78.     cmICCReservedFlagsMask        = 0x0000FFFF,                    /* these bits of the flags field are defined and reserved by ICC */
  79.     cmEmbeddedMask                = 0x00000001,                    /* if bit 0 is 0 then not embedded profile, if 1 then embedded profile */
  80.     cmEmbeddedUseMask            = 0x00000002,                    /* if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only */
  81.     cmCMSReservedFlagsMask        = (long)0xFFFF0000,                /* these bits of the flags field are defined and reserved by CMS vendor */
  82.     cmQualityMask                = 0x00030000,                    /* if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best */
  83.     cmInterpolationMask            = 0x00040000,                    /* if bit 18 is 0 then interpolation, if 1 then lookup only */
  84.     cmGamutCheckingMask            = 0x00080000                    /* if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info */
  85. };
  86.  
  87. /* copyright-protection flag options */
  88.  
  89. enum {
  90.     cmEmbeddedProfile            = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  91.     cmEmbeddedUse                = 1                                /* 0 is to use anywhere, 1 is to use as embedded profile only */
  92. };
  93.  
  94. /* speed and quality flag options */
  95.  
  96. enum {
  97.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  98.     cmDraftMode                    = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  99.     cmBestMode                    = 2                                /* high 14 bits, and then compare with the enum to determine the option value */
  100. };
  101.  
  102.  
  103. /**** deviceAttributes fields ****/
  104.  
  105. enum {
  106.     cmICCReservedAttr0Mask        = 0x0000FFFF,                    /* these bits of the deviceAttributes[0] field are defined and reserved by ICC */
  107.     cmReflectiveTransparentMask    = 0x00000001,                    /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  108.     cmGlossyMatteMask            = 0x00000002,                    /* if bit 1 is 0 then glossy, if 1 then matte */
  109.     cmVendorReservedAttr0Mask    = (long)0xFFFF0000,                /* these bits of the deviceAttributes[0] field are defined and reserved by device vendor */
  110.     cmVendorReservedAttr1Mask    = (long)0xFFFFFFFF                /* these bits of the deviceAttributes[1] field are defined and reserved by device vendor */
  111. };
  112.  
  113. /* device/media attributes element values  */
  114.  
  115. enum {
  116.     cmReflective                = 0,                            /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  117.     cmGlossy                    = 1                                /* if bit 1 is 0 then glossy, if 1 then matte */
  118. };
  119.  
  120.  
  121. /**** renderingIntent field ****/
  122.  
  123. enum {
  124.     cmPerceptual                = 0,                            /* Photographic images */
  125.     cmRelativeColorimetric        = 1,                            /* Logo Colors */
  126.     cmSaturation                = 2,                            /* Business graphics */
  127.     cmAbsoluteColorimetric        = 3                                /* Logo Colors */
  128. };
  129.  
  130.  
  131.  
  132. /* data type element values */
  133.  
  134. enum {
  135.     cmAsciiData                    = 0,
  136.     cmBinaryData                = 1
  137. };
  138.  
  139. /* screen encodings  */
  140.  
  141. enum {
  142.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  143.     cmLinesPer                    = 1                                /* 0 is LinesPerCm, 1 is LinesPerInch */
  144. };
  145.  
  146. /* 2.0 tag type information */
  147.  
  148. enum {
  149.     cmNumHeaderElements            = 10
  150. };
  151.  
  152. /* public tags */
  153.  
  154. enum {
  155.     cmAToB0Tag                    = FOUR_CHAR_CODE('A2B0'),
  156.     cmAToB1Tag                    = FOUR_CHAR_CODE('A2B1'),
  157.     cmAToB2Tag                    = FOUR_CHAR_CODE('A2B2'),
  158.     cmBlueColorantTag            = FOUR_CHAR_CODE('bXYZ'),
  159.     cmBlueTRCTag                = FOUR_CHAR_CODE('bTRC'),
  160.     cmBToA0Tag                    = FOUR_CHAR_CODE('B2A0'),
  161.     cmBToA1Tag                    = FOUR_CHAR_CODE('B2A1'),
  162.     cmBToA2Tag                    = FOUR_CHAR_CODE('B2A2'),
  163.     cmCalibrationDateTimeTag    = FOUR_CHAR_CODE('calt'),
  164.     cmCharTargetTag                = FOUR_CHAR_CODE('targ'),
  165.     cmCopyrightTag                = FOUR_CHAR_CODE('cprt'),
  166.     cmDeviceMfgDescTag            = FOUR_CHAR_CODE('dmnd'),
  167.     cmDeviceModelDescTag        = FOUR_CHAR_CODE('dmdd'),
  168.     cmGamutTag                    = FOUR_CHAR_CODE('gamt'),
  169.     cmGrayTRCTag                = FOUR_CHAR_CODE('kTRC'),
  170.     cmGreenColorantTag            = FOUR_CHAR_CODE('gXYZ'),
  171.     cmGreenTRCTag                = FOUR_CHAR_CODE('gTRC'),
  172.     cmLuminanceTag                = FOUR_CHAR_CODE('lumi'),
  173.     cmMeasurementTag            = FOUR_CHAR_CODE('meas'),
  174.     cmMediaBlackPointTag        = FOUR_CHAR_CODE('bkpt'),
  175.     cmMediaWhitePointTag        = FOUR_CHAR_CODE('wtpt'),
  176.     cmNamedColorTag                = FOUR_CHAR_CODE('ncol'),
  177.     cmNamedColor2Tag            = FOUR_CHAR_CODE('ncl2'),
  178.     cmPreview0Tag                = FOUR_CHAR_CODE('pre0'),
  179.     cmPreview1Tag                = FOUR_CHAR_CODE('pre1'),
  180.     cmPreview2Tag                = FOUR_CHAR_CODE('pre2'),
  181.     cmProfileDescriptionTag        = FOUR_CHAR_CODE('desc'),
  182.     cmProfileSequenceDescTag    = FOUR_CHAR_CODE('pseq'),
  183.     cmPS2CRD0Tag                = FOUR_CHAR_CODE('psd0'),
  184.     cmPS2CRD1Tag                = FOUR_CHAR_CODE('psd1'),
  185.     cmPS2CRD2Tag                = FOUR_CHAR_CODE('psd2'),
  186.     cmPS2CRD3Tag                = FOUR_CHAR_CODE('psd3'),
  187.     cmPS2CSATag                    = FOUR_CHAR_CODE('ps2s'),
  188.     cmPS2RenderingIntentTag        = FOUR_CHAR_CODE('ps2i'),
  189.     cmRedColorantTag            = FOUR_CHAR_CODE('rXYZ'),
  190.     cmRedTRCTag                    = FOUR_CHAR_CODE('rTRC'),
  191.     cmScreeningDescTag            = FOUR_CHAR_CODE('scrd'),
  192.     cmScreeningTag                = FOUR_CHAR_CODE('scrn'),
  193.     cmTechnologyTag                = FOUR_CHAR_CODE('tech'),
  194.     cmUcrBgTag                    = FOUR_CHAR_CODE('bfd '),
  195.     cmViewingConditionsDescTag    = FOUR_CHAR_CODE('vued'),
  196.     cmViewingConditionsTag        = FOUR_CHAR_CODE('view')
  197. };
  198.  
  199. /* custom tags */
  200.  
  201. enum {
  202.     cmPS2CRDVMSizeTag            = FOUR_CHAR_CODE('psvm')
  203. };
  204.  
  205. /* technology tag descriptions */
  206.  
  207. enum {
  208.     cmTechnologyFilmScanner        = FOUR_CHAR_CODE('fscn'),
  209.     cmTechnologyReflectiveScanner = FOUR_CHAR_CODE('rscn'),
  210.     cmTechnologyInkJetPrinter    = FOUR_CHAR_CODE('ijet'),
  211.     cmTechnologyThermalWaxPrinter = FOUR_CHAR_CODE('twax'),
  212.     cmTechnologyElectrophotographicPrinter = FOUR_CHAR_CODE('epho'),
  213.     cmTechnologyElectrostaticPrinter = FOUR_CHAR_CODE('esta'),
  214.     cmTechnologyDyeSublimationPrinter = FOUR_CHAR_CODE('dsub'),
  215.     cmTechnologyPhotographicPaperPrinter = FOUR_CHAR_CODE('rpho'),
  216.     cmTechnologyFilmWriter        = FOUR_CHAR_CODE('fprn'),
  217.     cmTechnologyVideoMonitor    = FOUR_CHAR_CODE('vidm'),
  218.     cmTechnologyVideoCamera        = FOUR_CHAR_CODE('vidc'),
  219.     cmTechnologyProjectionTelevision = FOUR_CHAR_CODE('pjtv'),
  220.     cmTechnologyCRTDisplay        = FOUR_CHAR_CODE('CRT '),
  221.     cmTechnologyPMDisplay        = FOUR_CHAR_CODE('PMD '),
  222.     cmTechnologyAMDisplay        = FOUR_CHAR_CODE('AMD '),
  223.     cmTechnologyPhotoCD            = FOUR_CHAR_CODE('KPCD'),
  224.     cmTechnologyPhotoImageSetter = FOUR_CHAR_CODE('imgs'),
  225.     cmTechnologyGravure            = FOUR_CHAR_CODE('grav'),
  226.     cmTechnologyOffsetLithography = FOUR_CHAR_CODE('offs'),
  227.     cmTechnologySilkscreen        = FOUR_CHAR_CODE('silk'),
  228.     cmTechnologyFlexography        = FOUR_CHAR_CODE('flex')
  229. };
  230.  
  231. /* type signatures */
  232.  
  233. enum {
  234.     cmSigCurveType                = FOUR_CHAR_CODE('curv'),
  235.     cmSigDataType                = FOUR_CHAR_CODE('data'),
  236.     cmSigDateTimeType            = FOUR_CHAR_CODE('dtim'),
  237.     cmSigLut16Type                = FOUR_CHAR_CODE('mft2'),
  238.     cmSigLut8Type                = FOUR_CHAR_CODE('mft1'),
  239.     cmSigMeasurementType        = FOUR_CHAR_CODE('meas'),
  240.     cmSigNamedColorType            = FOUR_CHAR_CODE('ncol'),
  241.     cmSigNamedColor2Type        = FOUR_CHAR_CODE('ncl2'),
  242.     cmSigProfileDescriptionType    = FOUR_CHAR_CODE('desc'),
  243.     cmSigScreeningType            = FOUR_CHAR_CODE('scrn'),
  244.     cmSigS15Fixed16Type            = FOUR_CHAR_CODE('sf32'),
  245.     cmSigSignatureType            = FOUR_CHAR_CODE('sig '),
  246.     cmSigTextType                = FOUR_CHAR_CODE('text'),
  247.     cmSigU16Fixed16Type            = FOUR_CHAR_CODE('uf32'),
  248.     cmSigU1Fixed15Type            = FOUR_CHAR_CODE('uf16'),
  249.     cmSigUInt32Type                = FOUR_CHAR_CODE('ui32'),
  250.     cmSigUInt64Type                = FOUR_CHAR_CODE('ui64'),
  251.     cmSigUInt8Type                = FOUR_CHAR_CODE('ui08'),
  252.     cmSigViewingConditionsType    = FOUR_CHAR_CODE('view'),
  253.     cmSigXYZType                = FOUR_CHAR_CODE('XYZ ')
  254. };
  255.  
  256. /* Measurement type encodings */
  257. /* Measurement Flare */
  258.  
  259. enum {
  260.     cmFlare0                    = 0x00000000,
  261.     cmFlare100                    = 0x00000001
  262. };
  263.  
  264. /* Measurement Geometry    */
  265.  
  266. enum {
  267.     cmGeometryUnknown            = 0x00000000,
  268.     cmGeometry045or450            = 0x00000001,
  269.     cmGeometry0dord0            = 0x00000002
  270. };
  271.  
  272. /* Standard Observer    */
  273.  
  274. enum {
  275.     cmStdobsUnknown                = 0x00000000,
  276.     cmStdobs1931TwoDegrees        = 0x00000001,
  277.     cmStdobs1964TenDegrees        = 0x00000002
  278. };
  279.  
  280. /* Standard Illuminant */
  281.  
  282. enum {
  283.     cmIlluminantUnknown            = 0x00000000,
  284.     cmIlluminantD50                = 0x00000001,
  285.     cmIlluminantD65                = 0x00000002,
  286.     cmIlluminantD93                = 0x00000003,
  287.     cmIlluminantF2                = 0x00000004,
  288.     cmIlluminantD55                = 0x00000005,
  289.     cmIlluminantA                = 0x00000006,
  290.     cmIlluminantEquiPower        = 0x00000007,
  291.     cmIlluminantF8                = 0x00000008
  292. };
  293.  
  294. /* Spot Function Value */
  295.  
  296. enum {
  297.     cmSpotFunctionUnknown        = 0,
  298.     cmSpotFunctionDefault        = 1,
  299.     cmSpotFunctionRound            = 2,
  300.     cmSpotFunctionDiamond        = 3,
  301.     cmSpotFunctionEllipse        = 4,
  302.     cmSpotFunctionLine            = 5,
  303.     cmSpotFunctionSquare        = 6,
  304.     cmSpotFunctionCross            = 7
  305. };
  306.  
  307. /* Color Space Signatures */
  308.  
  309. enum {
  310.     cmXYZData                    = FOUR_CHAR_CODE('XYZ '),
  311.     cmLabData                    = FOUR_CHAR_CODE('Lab '),
  312.     cmLuvData                    = FOUR_CHAR_CODE('Luv '),
  313.     cmYxyData                    = FOUR_CHAR_CODE('Yxy '),
  314.     cmRGBData                    = FOUR_CHAR_CODE('RGB '),
  315.     cmGrayData                    = FOUR_CHAR_CODE('GRAY'),
  316.     cmHSVData                    = FOUR_CHAR_CODE('HSV '),
  317.     cmHLSData                    = FOUR_CHAR_CODE('HLS '),
  318.     cmCMYKData                    = FOUR_CHAR_CODE('CMYK'),
  319.     cmCMYData                    = FOUR_CHAR_CODE('CMY '),
  320.     cmMCH5Data                    = FOUR_CHAR_CODE('MCH5'),
  321.     cmMCH6Data                    = FOUR_CHAR_CODE('MCH6'),
  322.     cmMCH7Data                    = FOUR_CHAR_CODE('MCH7'),
  323.     cmMCH8Data                    = FOUR_CHAR_CODE('MCH8')
  324. };
  325.  
  326. /* profileClass enumerations */
  327.  
  328. enum {
  329.     cmInputClass                = FOUR_CHAR_CODE('scnr'),
  330.     cmDisplayClass                = FOUR_CHAR_CODE('mntr'),
  331.     cmOutputClass                = FOUR_CHAR_CODE('prtr'),
  332.     cmLinkClass                    = FOUR_CHAR_CODE('link'),
  333.     cmAbstractClass                = FOUR_CHAR_CODE('abst'),
  334.     cmColorSpaceClass            = FOUR_CHAR_CODE('spac'),
  335.     cmNamedColorClass            = FOUR_CHAR_CODE('nmcl')
  336. };
  337.  
  338. /* platform enumerations */
  339.  
  340. enum {
  341.     cmMacintosh                    = FOUR_CHAR_CODE('APPL'),
  342.     cmMicrosoft                    = FOUR_CHAR_CODE('MSFT'),
  343.     cmSolaris                    = FOUR_CHAR_CODE('SUNW'),
  344.     cmSiliconGraphics            = FOUR_CHAR_CODE('SGI '),
  345.     cmTaligent                    = FOUR_CHAR_CODE('TGNT')
  346. };
  347.  
  348. /* ColorSync 1.0 elements */
  349.  
  350. enum {
  351.     cmCS1ChromTag                = FOUR_CHAR_CODE('chrm'),
  352.     cmCS1TRCTag                    = FOUR_CHAR_CODE('trc '),
  353.     cmCS1NameTag                = FOUR_CHAR_CODE('name'),
  354.     cmCS1CustTag                = FOUR_CHAR_CODE('cust')
  355. };
  356.  
  357. /* General element data types */
  358. struct CMDateTime {
  359.     unsigned short                     year;
  360.     unsigned short                     month;
  361.     unsigned short                     dayOfTheMonth;
  362.     unsigned short                     hours;
  363.     unsigned short                     minutes;
  364.     unsigned short                     seconds;
  365. };
  366. typedef struct CMDateTime CMDateTime;
  367.  
  368. struct CMFixedXYZColor {
  369.     Fixed                             X;
  370.     Fixed                             Y;
  371.     Fixed                             Z;
  372. };
  373. typedef struct CMFixedXYZColor CMFixedXYZColor;
  374.  
  375. typedef unsigned short                     CMXYZComponent;
  376. struct CMXYZColor {
  377.     CMXYZComponent                     X;
  378.     CMXYZComponent                     Y;
  379.     CMXYZComponent                     Z;
  380. };
  381. typedef struct CMXYZColor CMXYZColor;
  382.  
  383. struct CM2Header {
  384.     unsigned long                     size;                        /* This is the total size of the Profile */
  385.     OSType                             CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  386.     unsigned long                     profileVersion;                /* Version of CMProfile format */
  387.     OSType                             profileClass;                /* input, display, output, devicelink, abstract, or color conversion profile type */
  388.     OSType                             dataColorSpace;                /* color space of data */
  389.     OSType                             profileConnectionSpace;        /* profile connection color space */
  390.     CMDateTime                         dateTime;                    /* date and time of profile creation */
  391.     OSType                             CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  392.     OSType                             platform;                    /* primary profile platform, Registered with CS2 consortium */
  393.     unsigned long                     flags;                        /* profile flags */
  394.     OSType                             deviceManufacturer;            /* Registered with ICC consortium */
  395.     unsigned long                     deviceModel;                /* Registered with ICC consortium */
  396.     unsigned long                     deviceAttributes[2];        /* Attributes like paper type */
  397.     unsigned long                     renderingIntent;            /* preferred rendering intent of tagged object */
  398.     CMFixedXYZColor                 white;                        /* profile illuminant */
  399.     OSType                             creator;                    /* profile creator */
  400.     char                             reserved[44];                /* reserved for future use */
  401. };
  402. typedef struct CM2Header CM2Header;
  403.  
  404. struct CMTagRecord {
  405.     OSType                             tag;                        /* Registered with CS2 consortium */
  406.     unsigned long                     elementOffset;                /* Relative to start of CMProfile */
  407.     unsigned long                     elementSize;
  408. };
  409. typedef struct CMTagRecord CMTagRecord;
  410.  
  411. struct CMTagElemTable {
  412.     unsigned long                     count;
  413.     CMTagRecord                     tagList[1];                    /* Variable size */
  414. };
  415. typedef struct CMTagElemTable CMTagElemTable;
  416.  
  417. /* External 0x02002001 CMProfile */
  418. struct CM2Profile {
  419.     CM2Header                         header;
  420.     CMTagElemTable                     tagTable;
  421.     char                             elemData[1];                /* Tagged element storage. Variable size */
  422. };
  423. typedef struct CM2Profile CM2Profile;
  424.  
  425. typedef CM2Profile *                    CM2ProfilePtr;
  426. typedef CM2ProfilePtr *                    CM2ProfileHandle;
  427. /* Tag Type Definitions */
  428. struct CMCurveType {
  429.     OSType                             typeDescriptor;                /* 'curv' */
  430.     unsigned long                     reserved;                    /* fill with 0x00 */
  431.     unsigned long                     countValue;                    /* number of entries in table that follows */
  432.     unsigned short                     data[1];                    /* Tagged element storage. Variable size */
  433. };
  434. typedef struct CMCurveType CMCurveType;
  435.  
  436. struct CMDataType {
  437.     OSType                             typeDescriptor;                /* 'data' */
  438.     unsigned long                     reserved;                    /* fill with 0x00 */
  439.     unsigned long                     dataFlag;                    /* 0 = ASCII, 1 = binary */
  440.     char                             data[1];                    /* Tagged element storage. Variable size */
  441. };
  442. typedef struct CMDataType CMDataType;
  443.  
  444. struct CMDateTimeType {
  445.     OSType                             typeDescriptor;                /* 'dtim' */
  446.     unsigned long                     reserved;
  447.     CMDateTime                         dateTime;
  448. };
  449. typedef struct CMDateTimeType CMDateTimeType;
  450.  
  451. struct CMLut16Type {
  452.     OSType                             typeDescriptor;                /* 'mft2' */
  453.     unsigned long                     reserved;                    /* fill with 0x00 */
  454.     unsigned char                     inputChannels;                /* Number of input channels */
  455.     unsigned char                     outputChannels;                /* Number of output channels */
  456.     unsigned char                     gridPoints;                    /* Number of clutTable grid points */
  457.     unsigned char                     reserved2;                    /* fill with 0x00 */
  458.     Fixed                             matrix[3][3];                /* */
  459.     unsigned short                     inputTableEntries;            /* */
  460.     unsigned short                     outputTableEntries;            /* */
  461.     unsigned short                     inputTable[1];                /* Variable size */
  462.     unsigned short                     CLUT[1];                    /* Variable size */
  463.     unsigned short                     outputTable[1];                /* Variable size */
  464. };
  465. typedef struct CMLut16Type CMLut16Type;
  466.  
  467. struct CMLut8Type {
  468.     OSType                             typeDescriptor;                /* 'mft1' */
  469.     unsigned long                     reserved;                    /* fill with 0x00 */
  470.     unsigned char                     inputChannels;                /* */
  471.     unsigned char                     outputChannels;                /* */
  472.     unsigned char                     gridPoints;                    /* */
  473.     unsigned char                     reserved2;                    /* fill with 0x00 */
  474.     Fixed                             matrix[3][3];                /* */
  475.     unsigned char                     inputTable[256];            /* fixed size of 256 */
  476.     unsigned char                     CLUT[2];                    /* Variable size */
  477.     unsigned char                     outputTable[256];            /* fixed size of 256 */
  478. };
  479. typedef struct CMLut8Type CMLut8Type;
  480.  
  481. struct CMMeasurementType {
  482.     OSType                             typeDescriptor;                /* 'meas' */
  483.     unsigned long                     reserved;                    /* fill with 0x00 */
  484.     unsigned long                     standardObserver;            /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  485.     CMFixedXYZColor                 backingXYZ;                    /* absolute XYZ values of backing */
  486.     unsigned long                     geometry;                    /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  487.     unsigned long                     flare;                        /* 0 : 0%, 1 : 100% flare */
  488.     unsigned long                     illuminant;                    /* standard illuminant */
  489. };
  490. typedef struct CMMeasurementType CMMeasurementType;
  491.  
  492. struct CMNamedColorType {
  493.     OSType                             typeDescriptor;                /* 'ncol' */
  494.     unsigned long                     reserved;                    /* fill with 0x00 */
  495.     unsigned long                     vendorFlag;                    /* */
  496.     unsigned long                     count;                        /* count of named colors in array that follows */
  497.     unsigned char                     prefixName[1];                /* Variable size, max = 32, to access fields after this one, have to count bytes */
  498.     unsigned char                     suffixName[1];                /* Variable size, max = 32 */
  499.     char                             data[1];                    /* varaible size data as explained below */
  500. };
  501. typedef struct CMNamedColorType CMNamedColorType;
  502.  
  503. /*    
  504.     A variable size array of structs appears as the last block of data
  505.     in the above struct, CMNamedColorType.  The data structure
  506.     is as follows: (example in C)
  507.     
  508.      struct {                                             
  509.             unsigned char    rootName[1];                 * Variable size, max = 32 
  510.             unsigned char    colorCoords[1];                 * Variable size  
  511.      } colorName[1];                                     * Variable size  
  512. */
  513. struct CMNamedColor2Type {
  514.     OSType                             typeDescriptor;                /* 'ncl2' */
  515.     unsigned long                     reserved;                    /* fill with 0x00 */
  516.     unsigned long                     vendorFlag;                    /* lower 16 bits reserved for ICC use */
  517.     unsigned long                     count;                        /* count of named colors in array that follows */
  518.     unsigned long                     deviceChannelCount;            /* number of device channels, 0 indicates no device value available */
  519.     unsigned char                     prefixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  520.     unsigned char                     suffixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  521.     char                             data[1];                    /* varaible size data as explained below */
  522. };
  523. typedef struct CMNamedColor2Type CMNamedColor2Type;
  524.  
  525. /*    
  526.     A variable size array of structs appears as the last block of data
  527.     in the above struct, CMNamedColor2Type.  The data structure
  528.     is as follows: (example in C)
  529.     
  530.      struct {                                             
  531.             unsigned char    rootName[1];                 * 32 byte field.  7 bit ASCII null terminated
  532.             unsigned char    PCSColorCoords[1];             * Variable size  
  533.             unsigned char    DeviceColorCoords[1];         * Variable size  
  534.      } colorName2[1];                                     * Variable size  
  535. */
  536.  
  537. struct CMTextDescriptionType {
  538.     OSType                             typeDescriptor;                /* 'desc' */
  539.     unsigned long                     reserved;                    /* fill with 0x00 */
  540.     unsigned long                     ASCIICount;                    /* the count of "bytes" */
  541.     unsigned char                     ASCIIName[2];                /* Variable size, to access fields after this one, have to count bytes */
  542.     unsigned long                     UniCodeCode;
  543.     unsigned long                     UniCodeCount;                /* the count of characters, each character has two bytes */
  544.     unsigned char                     UniCodeName[2];                /* Variable size */
  545.     short                             ScriptCodeCode;
  546.     unsigned char                     ScriptCodeCount;            /* the count of "bytes" */
  547.     unsigned char                     ScriptCodeName[2];            /* Variable size */
  548. };
  549. typedef struct CMTextDescriptionType CMTextDescriptionType;
  550.  
  551. struct CMTextType {
  552.     OSType                             typeDescriptor;                /* 'text' */
  553.     unsigned long                     reserved;                    /* fill with 0x00 */
  554.     unsigned char                     text[1];                    /* count of text is obtained from tag size element */
  555. };
  556. typedef struct CMTextType CMTextType;
  557.  
  558. struct CMScreeningType {
  559.     OSType                             typeDescriptor;                /* 'scrn' */
  560.     unsigned long                     reserved;                    /* fill with 0x00 */
  561.     unsigned long                     screeningFlag;                /* bit 0 : use printer default screens, bit 1 : inch/cm */
  562.     unsigned long                     channelCount;
  563.     char                             data[1];                    /* varaible size data as explained below */
  564. };
  565. typedef struct CMScreeningType CMScreeningType;
  566.  
  567. /*
  568.     A variable size array of structs appears as the last block of data
  569.     in the above struct, CMScreeningType.  The data structure
  570.     is as follows: (example in C)
  571.     
  572.     struct {
  573.         Fixed            frequency;
  574.         Fixed            angle;
  575.         unsigned long    sportFunction;
  576.      }    channelScreening[1];                             * Variable size 
  577. */
  578. struct CMSignatureType {
  579.     OSType                             typeDescriptor;                /* 'sig ' */
  580.     unsigned long                     reserved;                    /* fill with 0x00 */
  581.     OSType                             signature;
  582. };
  583. typedef struct CMSignatureType CMSignatureType;
  584.  
  585. struct CMS15Fixed16ArrayType {
  586.     OSType                             typeDescriptor;                /* 'sf32' */
  587.     unsigned long                     reserved;                    /* fill with 0x00 */
  588.     Fixed                             value[1];                    /* Variable size */
  589. };
  590. typedef struct CMS15Fixed16ArrayType CMS15Fixed16ArrayType;
  591.  
  592. struct CMU16Fixed16ArrayType {
  593.     OSType                             typeDescriptor;                /* 'uf32' */
  594.     unsigned long                     reserved;                    /* fill with 0x00 */
  595.     unsigned long                     value[1];                    /* Variable size */
  596. };
  597. typedef struct CMU16Fixed16ArrayType CMU16Fixed16ArrayType;
  598.  
  599. struct CMUInt16ArrayType {
  600.     OSType                             typeDescriptor;                /* 'ui16' */
  601.     unsigned long                     reserved;                    /* fill with 0x00 */
  602.     unsigned short                     value[1];                    /* Variable size */
  603. };
  604. typedef struct CMUInt16ArrayType CMUInt16ArrayType;
  605.  
  606. struct CMUInt32ArrayType {
  607.     OSType                             typeDescriptor;                /* 'ui32' */
  608.     unsigned long                     reserved;                    /* fill with 0x00 */
  609.     unsigned long                     value[1];                    /* Variable size */
  610. };
  611. typedef struct CMUInt32ArrayType CMUInt32ArrayType;
  612.  
  613. struct CMUInt64ArrayType {
  614.     OSType                             typeDescriptor;                /* 'ui64' */
  615.     unsigned long                     reserved;                    /* fill with 0x00 */
  616.     unsigned long                     value[1];                    /* Variable size (x2) */
  617. };
  618. typedef struct CMUInt64ArrayType CMUInt64ArrayType;
  619.  
  620. struct CMUInt8ArrayType {
  621.     OSType                             typeDescriptor;                /* 'ui08' */
  622.     unsigned long                     reserved;                    /* fill with 0x00 */
  623.     unsigned char                     value[1];                    /* Variable size */
  624. };
  625. typedef struct CMUInt8ArrayType CMUInt8ArrayType;
  626.  
  627. struct CMViewingConditionsType {
  628.     OSType                             typeDescriptor;                /* 'view' */
  629.     unsigned long                     reserved;                    /* fill with 0x00 */
  630.     CMFixedXYZColor                 illuminant;                    /* absolute XYZs of illuminant  in cd/m^2 */
  631.     CMFixedXYZColor                 surround;                    /* absolute XYZs of surround in cd/m^2 */
  632.     unsigned long                     stdIlluminant;                /* see definitions of std illuminants */
  633. };
  634. typedef struct CMViewingConditionsType CMViewingConditionsType;
  635.  
  636. struct CMXYZType {
  637.     OSType                             typeDescriptor;                /* 'XYZ ' */
  638.     unsigned long                     reserved;                    /* fill with 0x00 */
  639.     CMFixedXYZColor                 XYZ[1];                        /* variable size XYZ tristimulus values */
  640. };
  641. typedef struct CMXYZType CMXYZType;
  642.  
  643. /* Profile sequence description type */
  644. struct CMProfileSequenceDescType {
  645.     OSType                             typeDescriptor;                /* 'pseq ' */
  646.     unsigned long                     reserved;                    /* fill with 0x00 */
  647.     unsigned long                     count;                        /* Number of descriptions */
  648.     char                             data[1];                    /* varaible size data as explained below */
  649. };
  650. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  651.  
  652. /*
  653.     A variable size array of structs appears as the last block of data
  654.     in the above struct, CMProfileSequenceDescType.  The data structure
  655.     is as follows: (example in C)
  656.     
  657.      struct {                                             
  658.             OSType            deviceMfg;                     * Device Manufacturer 
  659.             OSType            deviceModel;                 * Decvice Model 
  660.             unsigned long    attributes[2];                 * Device attributes 
  661.             OSType            technology;                     * Technology signature 
  662.             unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  663.             unsigned char    mfgDescASCIIName[2];         * Variable size 
  664.             unsigned long    mfgDescUniCodeCode;             
  665.             unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  666.             unsigned char    mfgDescUniCodeName[2];         * Variable size 
  667.             unsigned long    mfgDescScriptCodeCode;         
  668.             unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  669.             unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  670.             unsigned long    modelDescASCIICount;         * the count of "bytes" 
  671.             unsigned char    modelDescASCIIName[2];         * Variable size 
  672.             unsigned long    modelDescUniCodeCode;         
  673.             unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  674.             unsigned char    modelDescUniCodeName[2];     * Variable size 
  675.             short            modelDescScriptCodeCode;     
  676.             unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  677.             SInt8            filler;                         * For proper alignment across languages 
  678.             unsigned char    modelDescScriptCodeName[2];     * Variable size 
  679.      }    profileDescription[1];                         
  680. */
  681.  
  682. /* Under color removal, black generation type */
  683. struct CMUcrBgType {
  684.     OSType                             typeDescriptor;                /* 'bfd  ' */
  685.     unsigned long                     reserved;                    /* fill with 0x00 */
  686.     unsigned long                     ucrCount;                    /* Number of UCR entries */
  687.     unsigned short                     ucrValues[1];                /* variable size */
  688.     unsigned long                     bgCount;                    /* Number of BG entries */
  689.     unsigned short                     bgValues[1];                /* variable size */
  690.     unsigned char                     ucrbgASCII[1];                /* null terminated ASCII string */
  691. };
  692. typedef struct CMUcrBgType CMUcrBgType;
  693.  
  694. struct CMIntentCRDVMSize {
  695.     long                             renderingIntent;            /* rendering intent */
  696.     unsigned long                     VMSize;                        /* VM size taken up by the CRD */
  697. };
  698. typedef struct CMIntentCRDVMSize CMIntentCRDVMSize;
  699.  
  700. struct CMPS2CRDVMSizeType {
  701.     OSType                             typeDescriptor;                /* 'psvm' */
  702.     unsigned long                     reserved;                    /* fill with 0x00 */
  703.     unsigned long                     count;                        /* number of intent entries */
  704.     CMIntentCRDVMSize                 intentCRD[1];                /* variable size */
  705. };
  706. typedef struct CMPS2CRDVMSizeType CMPS2CRDVMSizeType;
  707.  
  708. /************************************************************************/
  709. /*************** ColorSync 1.0 profile specification ********************/
  710. /************************************************************************/
  711.  
  712. enum {
  713.     cmGrayResponse                = 0,
  714.     cmRedResponse                = 1,
  715.     cmGreenResponse                = 2,
  716.     cmBlueResponse                = 3,
  717.     cmCyanResponse                = 4,
  718.     cmMagentaResponse            = 5,
  719.     cmYellowResponse            = 6,
  720.     cmUcrResponse                = 7,
  721.     cmBgResponse                = 8,
  722.     cmOnePlusLastResponse        = 9
  723. };
  724.  
  725.  
  726. /* Device types */
  727.  
  728. enum {
  729.     cmMonitorDevice                = FOUR_CHAR_CODE('mntr'),
  730.     cmScannerDevice                = FOUR_CHAR_CODE('scnr'),
  731.     cmPrinterDevice                = FOUR_CHAR_CODE('prtr')
  732. };
  733.  
  734.  
  735. struct CMIString {
  736.     ScriptCode                         theScript;
  737.     Str63                             theString;
  738. };
  739. typedef struct CMIString CMIString;
  740.  
  741. /* Profile options */
  742.  
  743. enum {
  744.     cmPerceptualMatch            = 0x0000,                        /* Default. For photographic images */
  745.     cmColorimetricMatch            = 0x0001,                        /* Exact matching when possible */
  746.     cmSaturationMatch            = 0x0002                        /* For solid colors */
  747. };
  748.  
  749. /* Profile flags */
  750.  
  751. enum {
  752.     cmNativeMatchingPreferred    = 0x00000001,                    /* Default to native not preferred */
  753.     cmTurnOffCache                = 0x00000002                    /* Default to turn on CMM cache */
  754. };
  755.  
  756. typedef long                             CMMatchOption;
  757. typedef long                             CMMatchFlag;
  758. struct CMHeader {
  759.     unsigned long                     size;
  760.     OSType                             CMMType;
  761.     unsigned long                     applProfileVersion;
  762.     OSType                             dataType;
  763.     OSType                             deviceType;
  764.     OSType                             deviceManufacturer;
  765.     unsigned long                     deviceModel;
  766.     unsigned long                     deviceAttributes[2];
  767.     unsigned long                     profileNameOffset;
  768.     unsigned long                     customDataOffset;
  769.     CMMatchFlag                     flags;
  770.     CMMatchOption                     options;
  771.     CMXYZColor                         white;
  772.     CMXYZColor                         black;
  773. };
  774. typedef struct CMHeader CMHeader;
  775.  
  776. struct CMProfileChromaticities {
  777.     CMXYZColor                         red;
  778.     CMXYZColor                         green;
  779.     CMXYZColor                         blue;
  780.     CMXYZColor                         cyan;
  781.     CMXYZColor                         magenta;
  782.     CMXYZColor                         yellow;
  783. };
  784. typedef struct CMProfileChromaticities CMProfileChromaticities;
  785.  
  786. struct CMProfileResponse {
  787.     unsigned short                     counts[9];
  788.     unsigned short                     data[1];                    /* Variable size */
  789. };
  790. typedef struct CMProfileResponse CMProfileResponse;
  791.  
  792. struct CMProfile {
  793.     CMHeader                         header;
  794.     CMProfileChromaticities         profile;
  795.     CMProfileResponse                 response;
  796.     CMIString                         profileName;
  797.     char                             customData[1];                /* Variable size */
  798. };
  799. typedef struct CMProfile CMProfile;
  800.  
  801. typedef CMProfile *                        CMProfilePtr;
  802. typedef CMProfilePtr *                    CMProfileHandle;
  803. #if OLDROUTINENAMES
  804.  
  805. enum {
  806.     kCMApplProfileVersion        = cmCS1ProfileVersion
  807. };
  808.  
  809.  
  810. enum {
  811.     grayResponse                = cmGrayResponse,
  812.     redResponse                    = cmRedResponse,
  813.     greenResponse                = cmGreenResponse,
  814.     blueResponse                = cmBlueResponse,
  815.     cyanResponse                = cmCyanResponse,
  816.     magentaResponse                = cmMagentaResponse,
  817.     yellowResponse                = cmYellowResponse,
  818.     ucrResponse                    = cmUcrResponse,
  819.     bgResponse                    = cmBgResponse,
  820.     onePlusLastResponse            = cmOnePlusLastResponse
  821. };
  822.  
  823.  
  824. enum {
  825.     rgbData                        = cmRGBData,
  826.     cmykData                    = cmCMYKData,
  827.     grayData                    = cmGrayData,
  828.     xyzData                        = cmXYZData
  829. };
  830.  
  831.  
  832. enum {
  833.     XYZData                        = cmXYZData
  834. };
  835.  
  836.  
  837. enum {
  838.     monitorDevice                = cmMonitorDevice,
  839.     scannerDevice                = cmScannerDevice,
  840.     printerDevice                = cmPrinterDevice
  841. };
  842.  
  843.  
  844. enum {
  845.     CMNativeMatchingPreferred    = cmNativeMatchingPreferred,    /* Default to native not preferred */
  846.     CMTurnOffCache                = cmTurnOffCache                /* Default to turn on CMM cache */
  847. };
  848.  
  849.  
  850. enum {
  851.     CMPerceptualMatch            = cmPerceptualMatch,            /* Default. For photographic images */
  852.     CMColorimetricMatch            = cmColorimetricMatch,            /* Exact matching when possible */
  853.     CMSaturationMatch            = cmSaturationMatch                /* For solid colors */
  854. };
  855.  
  856. typedef unsigned short                     XYZComponent;
  857. typedef CMXYZColor                         XYZColor;
  858. typedef unsigned short                     CMResponseData;
  859. typedef CMIString                         IString;
  860. typedef long                             CMResponseColor;
  861. typedef CMResponseColor                 responseColor;
  862.  
  863. #endif  /* OLDROUTINENAMES */
  864.  
  865.  
  866.  
  867. #if PRAGMA_STRUCT_ALIGN
  868.     #pragma options align=reset
  869. #elif PRAGMA_STRUCT_PACKPUSH
  870.     #pragma pack(pop)
  871. #elif PRAGMA_STRUCT_PACK
  872.     #pragma pack()
  873. #endif
  874.  
  875. #ifdef PRAGMA_IMPORT_OFF
  876. #pragma import off
  877. #elif PRAGMA_IMPORT
  878. #pragma import reset
  879. #endif
  880.  
  881. #ifdef __cplusplus
  882. }
  883. #endif
  884.  
  885. #endif /* __CMICCPROFILE__ */
  886.  
  887.